package minidb.record;
 
import minidb.type.fieldinfo;
import static minidb.type.Const.*;
public class Schema {
	private java.util.HashMap<String, fieldinfo> schema;
	
	public Schema(){
		schema = new java.util.HashMap<String, fieldinfo>();
	}
	
	public void add(String fieldName, TYPE type, int length, int position){
		schema.put(fieldName, new fieldinfo(fieldName, type, length, position) );
	}
	
	public void add(fieldinfo finfo){
		schema.put(finfo.name(), finfo);
	}
	public void delete(String fieldName){
		schema.remove(fieldName);
	}
	
	public fieldinfo get(String fieldName){
		return schema.get(fieldName);
	}
	
	public java.util.Collection<fieldinfo> values() {
		return schema.values();
	}

	public java.util.Set<String> fieldName(){
		return schema.keySet();
	}
}
